{% extends "adminlte/lib/_main_sidebar.html" %}
{% load is_active %}

{% block user_panel %}
{% endblock %}

{% block nav_links %}
    <li class="{% is_active '/' %}">
        <a href="/">
            <i class="fa fa-dashboard"></i> <span>主页</span>
        </a>
    </li>

    {% for sidebar in sidebar_config.bars %}
        {% if sidebar.sub_menu %}
        <li class="treeview {% is_active '{{ sidebar.entity }}' %}">
            <a href="#"><i class="fa {{ sidebar.logo }}"></i> <span>{{ sidebar.name }}</span> <i class="fa fa-angle-left pull-right"></i></a>
            {% for subsidebar in sidebar.sub_menu %}
                <ul class="treeview-menu">
                <li><a href="/{{ sidebar.entity }}/{{ subsidebar.entity }}/list">{{ subsidebar.name }}</a></li>
                </ul>
            {% endfor %}
        </li>
        {% else %}
        <li class="{% is_active '/{{ sidebar.entity }}/' %}">
            <a href="/{{ sidebar.entity }}/{% include 'adminlte/lib/_sidebar_urls.html' %}">
                <i class="fa {{ sidebar.logo }}"></i> <span>{{ sidebar.name }}</span>
            </a>
        </li>
        {% endif %}
    {% endfor %}

{% endblock nav_links %}